#!/usr/bin/env python3
"""
临时禁用认证 - 让项目快速启动
"""
from pathlib import Path

def disable_auth():
    """临时禁用认证相关代码"""
    
    # 修改main.py，注释掉auth_api的导入
    main_file = Path('main.py')
    if main_file.exists():
        with open(main_file, 'r', encoding='utf-8') as f:
            content = f.read()
        
        # 注释掉auth_api导入
        content = content.replace(
            'from app.routers import auth_api',
            '# from app.routers import auth_api  # 临时禁用'
        )
        content = content.replace(
            'app.include_router(auth_api.router',
            '# app.include_router(auth_api.router  # 临时禁用'
        )
        
        with open(main_file, 'w', encoding='utf-8') as f:
            f.write(content)
        
        print("✅ 已临时禁用认证模块")
        return True
    
    return False

if __name__ == "__main__":
    disable_auth() 